<div class="form wide">

<?php $form=$this->beginWidget('FActiveForm', array(
	'id'=>'page-form-content',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

    <?php if (!$model->IsNewRecord) echo $form->hiddenField($model, "id") ; ?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'page_data'); ?>
		<?php echo $form->textArea($model,'page_data',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'page_data'); ?>
	</div>
    
    <?php if (!$model->isNewRecord):?>
    <div class="row">
        <label>&nbsp;</label>
        <?php echo FHtml::checkBox('IsUpdated', !$model->isNewRecord); ?>
        <label for="IsUpdated" style="float:none;width: auto;text-align:left; display:inline">Minor change, do not create new revision</label>
    </div>
    <?php endif; ?>

	<div class="row">
		<?php echo $form->labelEx($model,'revised_by'); ?>
		<?php echo $form->dropDownList($model, 'revised_by', $model->userOptions); ?>
		<?php echo $form->error($model,'revised_by'); ?>
	</div>
    
    <?php 
        if ($model->isNewRecord) {
            $model->revision_id = 0;
        }
        if (!$model->isNewRecord) : 
    ?>
            <div class="row">
                <?php echo $form->labelEx($model,'revision_id'); ?>
                <?php echo $model->revision_id; ?>
            </div>
            
			<div class="row">
				<?php echo $form->labelEx($model,'creation_datetime'); ?>
		        <?php echo Yii::app()->getDateFormatter()->formatDateTime(strtotime($model->creation_datetime)); ?>
			</div>

			<div class="row">
				<?php echo $form->labelEx($model,'last_update'); ?>
		        <?php echo Yii::app()->getDateFormatter()->formatDateTime(strtotime($model->last_update)); ?>
			</div>
	<?php endif; ?>
	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>		
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->